<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>直播销售系统时区处理演示</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#0FC6C2',
                        success: '#00B42A',
                        warning: '#FF7D00',
                        danger: '#F53F3F',
                        dark: '#1D2129',
                        light: '#F2F3F5'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
</head>
<body class="font-inter bg-gray-50 text-dark min-h-screen flex flex-col">
    <header class="bg-white shadow-sm py-4">
        <div class="container mx-auto px-4 flex items-center justify-between">
            <h1 class="text-xl font-bold text-primary">直播销售系统时区处理演示</h1>
        </div>
    </header>

    <main class="flex-grow container mx-auto px-4 py-6">
        <div class="bg-white rounded-xl shadow-sm p-6 max-w-2xl mx-auto">
            <h2 class="text-xl font-semibold mb-6">直播日程</h2>
            
            <!-- 直播日程组件容器 -->
            <div id="live-schedule" class="mb-6"></div>
            
            <div class="mt-8 p-4 bg-gray-50 rounded-lg">
                <h3 class="font-medium mb-3">时区转换说明</h3>
                <p class="text-sm text-gray-600 mb-2">本系统支持全球多地区用户查看正确的直播时间：</p>
                <ul class="text-sm text-gray-600 list-disc list-inside space-y-1">
                    <li>自动检测用户浏览器时区并显示对应的本地时间</li>
                    <li>支持手动切换时区，方便用户查看不同地区的时间</li>
                    <li>实时计算与北京时间的时差，帮助用户快速理解时间差异</li>
                    <li>提供倒计时功能，显示距离直播开始的剩余时间</li>
                </ul>
            </div>
        </div>
    </main>

    <footer class="bg-white border-t border-gray-200 py-4 mt-8">
        <div class="container mx-auto px-4 text-center text-gray-500 text-sm">
            <p>© 2025 直播销售系统 | 时区处理演示</p>
        </div>
    </footer>

    <script src="timezone-handler.js"></script>
    <script src="live-schedule.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 创建直播日程组件实例
            const liveSchedule = new LiveSchedule('live-schedule');
            
            // 设置直播开始时间（示例：2025年6月10日 20:00:00 北京时间）
            const liveStartTime = new Date('2025-06-10T20:00:00+08:00');
            liveSchedule.setLiveStartTime(liveStartTime);
        });
    </script>
</body>
</html>    